-
Notifications
You must be signed in to change notification settings - Fork 9
feat: support l3d-dash (SSR) #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Squash merge l3d-dash (#12) * Add low delay config to urlgen * Fix low delay config in urlgen and read it on livempd * mpd profile DASHProfileLinear * add SchemeIdUriSSR to essential property on representations * Set Role as main in main Adaptation Set * cleanup for fresh start * update LowDelay flag to take value from url instead of query parameter * add essential property, role and startWithSAP at Adaptation Set level * PartialSegments configuracion added to ResponseConfig and urlgen form * Revert "PartialSegments configuracion added to ResponseConfig and urlgen form" This reverts commit 491b159. * add SubNumber for Low Delay to SegmentTimeline with $Number$ * rename LowDelayFlag * l3d-dash/S@k (#3) * Add chunkDuration parameter to generateTimelineEntries and related functions, calculating s@k and adding it to mpd * Add simple Unit Tests for Calculate K function * Add unit test for generateTimelineEntries with chunkDuration cases * Moved Low Delay Checkbox to Low Latency section * Update code to only send `s@K` if Low Latency flag is on * Add LowDelay support and refactor related configurations * l3d-dash/calc_subsegment_part_unit_tests (#5) * Enhance calcSubSegementPart function to handle errors and add comprehensive unit tests * Refactor segment handling: split writeChunkedSegment into prepareChunks and setHeaders for improved readability and error handling * Add TestWriteSubSegment for validating sub-segment handling and error cases * Refactor TestWriteSubSegment: remove unused mediaTimescale and cancelContext fields for clarity * Update cmd/livesim2/app/livesegment_test.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Refactor TestWriteSubSegment: add availabilityTimeOffsetS to test cases for improved accuracy * Fix wrong chunk index generation * Implement SegmentSequenceProperties for l3d * Undo SegmentSequenceProperties implementation * Implement single chunk generation in the sub segments * Remove unused lowDelay config * Remove unnecessary sleep on writing sub segemnts * Add l3d testdata * Fix writeSubSegment debug messages * Fix wrong asset naming * Update l3d dash to no-cmaf * Fix return segements without a sub segment * Add audio to de l3d-dash sample and fix template generation * Fix unit test * Update Low Delay sample * Add SubNumber to $Time$ with SegmentTimeline * feat: update dash-mpd to v0.13.0 and improve Makefile * fix: use new S type struct from dash-mpd * feat: add L3D to Number wo timeline * fix: failing tests with K * feat: Add SegmentSequenceProperties element * fix: availabilityTimeOffset not defined issue * fix: lint errors * fix: lint errors * remove unnecessary withe spaces * refactor: rename chunk duration parameters for clarity * refactor: update comments related with low-delay for clarity * refactor: rename chunk duration in seconds variable for clarity * refactor: rename DASH profile constant for consistency and update usage in LiveMPD function * fix: remove duration attribute from Period element for clarity * refactor: Add chunkIndex explanation comment in the chunkSegment generation * rafactor: Update ssr schme uri constant naming aligment * rafactor: update writeSubSegment comments for clarity * rafactor: remove harcoded role for low delay assets * refactor: rename low delay mode to SSR and update related configurations * refactor ssr essential property * switching implementation * remove cfg EnableSSR from handler livesim * fix * test fix * fix * add lowdelay chunk duration config * parse low dealy chunk duration * add unit test cases * add chunk duration for low delay * bugfix * bugfix - representation id regex update when the id string is a substring of other representation id * update assets for low delay and regular renditions * update assets for low delay and regular renditions * refactor low delay flag and implement k for low latency * code refactor * code refactor * remove unused parameter * add comment * condition refactor * refactor segment template for low delay and added low latency cadence * fix linter issues * ssr html name update * remove segment sequence properties from low delay low latency * remove cadence from low latency and add ssr * low latency start with sap * low delay audio * rename low delay adaptation set to ssrAS * rename low delay chunk duration to chunk dur ssr * Fixed validation to ensure adaptationSetId is a non-negative integer * Adding ProfileAdvancedLinear only if it is not already included * Fix typo * Error handling for pairs different than 2 * Error handling for extra spaces on configuration * Error handling chunk duration greater than segment duration * Error handling for empty and invalid configurations * Fix chunking fallback * AvailabilityTimeOffset left as default and ignored for SSR * Remove availabilityTimeOffset from write sub segment test * remove space * fix chunkdurssr cant be used on its own * Fix chunking fallback * fix chunkdurssr cant be used on its own * AvailabilityTimeOffset left as default and ignored for SSR * remove space * error handling for ssras not configured when using chunkdurssr * unit test fix * fixes after main merge * revert anchor regex for matching representations --------- Co-authored-by: Juan Manuel Gonzalez <[email protected]> Co-authored-by: Sebastian Piquerez <[email protected]> Co-authored-by: Juan Manuel Gonzalez <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Sebastian Piquerez <[email protected]> Co-authored-by: Emil Santurio <[email protected]> Co-authored-by: Torbjörn Einarsson <[email protected]>
Thumbnails cannot be chunked like MP4 segments and were failing in low-latency streams.
|
Sorry for the long time to respond. Thanks for the PR. I haven't looked at the code yet, but regarding the documentation, I think it would benefit by a description that L3D is a solution using multiple tools and explain what these tools are. For example, SSR is used in many places, but the SSR abbreviation is not explained. I plan to look more into this when I'm back from Demuxed. |
* fix k calculation for no timeline * Update cmd/livesim2/app/livempd.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: ¨Constanza <¨[email protected]¨> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Squash merge l3d-dash (#12) * Add low delay config to urlgen * Fix low delay config in urlgen and read it on livempd * mpd profile DASHProfileLinear * add SchemeIdUriSSR to essential property on representations * Set Role as main in main Adaptation Set * cleanup for fresh start * update LowDelay flag to take value from url instead of query parameter * add essential property, role and startWithSAP at Adaptation Set level * PartialSegments configuracion added to ResponseConfig and urlgen form * Revert "PartialSegments configuracion added to ResponseConfig and urlgen form" This reverts commit 491b159. * add SubNumber for Low Delay to SegmentTimeline with $Number$ * rename LowDelayFlag * l3d-dash/S@k (#3) * Add chunkDuration parameter to generateTimelineEntries and related functions, calculating s@k and adding it to mpd * Add simple Unit Tests for Calculate K function * Add unit test for generateTimelineEntries with chunkDuration cases * Moved Low Delay Checkbox to Low Latency section * Update code to only send `s@K` if Low Latency flag is on * Add LowDelay support and refactor related configurations * l3d-dash/calc_subsegment_part_unit_tests (#5) * Enhance calcSubSegementPart function to handle errors and add comprehensive unit tests * Refactor segment handling: split writeChunkedSegment into prepareChunks and setHeaders for improved readability and error handling * Add TestWriteSubSegment for validating sub-segment handling and error cases * Refactor TestWriteSubSegment: remove unused mediaTimescale and cancelContext fields for clarity * Update cmd/livesim2/app/livesegment_test.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Refactor TestWriteSubSegment: add availabilityTimeOffsetS to test cases for improved accuracy * Fix wrong chunk index generation * Implement SegmentSequenceProperties for l3d * Undo SegmentSequenceProperties implementation * Implement single chunk generation in the sub segments * Remove unused lowDelay config * Remove unnecessary sleep on writing sub segemnts * Add l3d testdata * Fix writeSubSegment debug messages * Fix wrong asset naming * Update l3d dash to no-cmaf * Fix return segements without a sub segment * Add audio to de l3d-dash sample and fix template generation * Fix unit test * Update Low Delay sample * Add SubNumber to $Time$ with SegmentTimeline * feat: update dash-mpd to v0.13.0 and improve Makefile * fix: use new S type struct from dash-mpd * feat: add L3D to Number wo timeline * fix: failing tests with K * feat: Add SegmentSequenceProperties element * fix: availabilityTimeOffset not defined issue * fix: lint errors * fix: lint errors * remove unnecessary withe spaces * refactor: rename chunk duration parameters for clarity * refactor: update comments related with low-delay for clarity * refactor: rename chunk duration in seconds variable for clarity * refactor: rename DASH profile constant for consistency and update usage in LiveMPD function * fix: remove duration attribute from Period element for clarity * refactor: Add chunkIndex explanation comment in the chunkSegment generation * rafactor: Update ssr schme uri constant naming aligment * rafactor: update writeSubSegment comments for clarity * rafactor: remove harcoded role for low delay assets * refactor: rename low delay mode to SSR and update related configurations * refactor ssr essential property * switching implementation * remove cfg EnableSSR from handler livesim * fix * test fix * fix * add lowdelay chunk duration config * parse low dealy chunk duration * add unit test cases * add chunk duration for low delay * bugfix * bugfix - representation id regex update when the id string is a substring of other representation id * update assets for low delay and regular renditions * update assets for low delay and regular renditions * refactor low delay flag and implement k for low latency * code refactor * code refactor * remove unused parameter * add comment * condition refactor * refactor segment template for low delay and added low latency cadence * fix linter issues * ssr html name update * remove segment sequence properties from low delay low latency * remove cadence from low latency and add ssr * low latency start with sap * low delay audio * rename low delay adaptation set to ssrAS * rename low delay chunk duration to chunk dur ssr * Fixed validation to ensure adaptationSetId is a non-negative integer * Adding ProfileAdvancedLinear only if it is not already included * Fix typo * Error handling for pairs different than 2 * Error handling for extra spaces on configuration * Error handling chunk duration greater than segment duration * Error handling for empty and invalid configurations * Fix chunking fallback * AvailabilityTimeOffset left as default and ignored for SSR * Remove availabilityTimeOffset from write sub segment test * remove space * fix chunkdurssr cant be used on its own * Fix chunking fallback * fix chunkdurssr cant be used on its own * AvailabilityTimeOffset left as default and ignored for SSR * remove space * error handling for ssras not configured when using chunkdurssr * unit test fix * fixes after main merge * revert anchor regex for matching representations --------- Co-authored-by: Juan Manuel Gonzalez <[email protected]> Co-authored-by: Sebastian Piquerez <[email protected]> Co-authored-by: Juan Manuel Gonzalez <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Sebastian Piquerez <[email protected]> Co-authored-by: Emil Santurio <[email protected]> Co-authored-by: Torbjörn Einarsson <[email protected]>
* fix k calculation for no timeline * Update cmd/livesim2/app/livempd.go Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: ¨Constanza <¨[email protected]¨> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
There is now a dash.js Release candidate: https://github.com/Dash-Industry-Forum/dash.js/tree/RC_v5.1.0 |
|
@cotid-qualabs @sebastianpiq Any update on this? Would be great if you can update with the playback status with dash.js and other players. A rebase om the main branch with a linear git commit history for this PR would also be nice before approving and merging this PR. I think there may be some collisions with PR #272 on Pattern, but I can wait a bit more with that one. |

L3D-DASH Support
This pull request introduces the support for Low-Latency & Low-Delay DASH (L3D)
Functionality Overview
The L3D implementation generates individual chunks from full segments, enabling progressive media delivery. The system uses writeSubSegment to handle chunk requests and prepareChunks to divide segments into smaller temporal units. Chunk duration can be configured explicitly via URL parameters.
Main Changes
Added DASHProfileLinear profile for SSR streaming compliance
Implemented EssentialProperty with
urn:mpeg:dash:ssr:2023 schema referenceImplemented SupplementalProperty with
urn:mpeg:dash:adaptation-set-switching:2016Set
startWithSAP=1for proper stream initializationAdded SegmentSequenceProperties with
sapType=1andcadence=1to enable playback initialization on any chunkImplemented SubNumber on media Segment Template
Introduced calculateK function to compute
S@kvalue for proper segment indexingEnhanced sub-segment chunking support for low-latency & low-delay delivery
Created
SSRUI section in the URL generator for easy configurationAdded
ssrASandchunkDurSSRURL parameter for enabling Low Delay mode for both video and audio adaptation sets.Updated URL generation logic to properly handle low-delay streaming parameters
Implemented EssentialProperty with
urn:mpeg:dash:ssr:2023schema referenceImplemented SupplementalProperty with
urn:mpeg:dash:adaptation-set-switching:2016Set
startWithSAP=1for proper stream initializationImplemented SubNumber on media Segment Template
Compute
S@kUpdated dash-mpd library to v0.13.0 for improved MPD parsing and generation capabilities
Adapted to new S type struct from the updated dash-mpd library
How to generate a Low Delay URL
adaptationSetId,ssrValue;adaptationSetId,ssrValue;...where ssrValue is the value of ssr EssentialProperty (supports both video and audio adaptation set)adaptationSetId,chunkDuration;adaptationSetId,chunkDuration;...(supports both video and audio adaptation set)How to generate a L3D (Low Delay & Low Latency) URL
adaptationSetId,ssrValue;adaptationSetId,ssrValue;...where ssrValue is the value of ssr EssentialProperty (supports both video and audio adaptation set)adaptationSetId,chunkDuration;adaptationSetId,chunkDuration;...(supports both video and audio adaptation set)Supported Use Cases
Configuration example:
SSR Configuration:
1,0Switching Logic:
AS1: SSR value="0" → Next reproduction is AS0
AS0: No SSR → Final low-latency regular content
Configuration example:
SSR Configuration:
2,1;1,0chunk duration for low delay:
2,0.2;1,0.5Switching Logic:
AS2: SSR value="1" → Next reproduction is AS1
AS1: SSR value="0" → Next reproduction is AS0
AS0: No SSR → Final low-latency regular content
Configuration example:
SSR Configuration: `3,2;1,0
Switching Logic:
**AS1 (video) **: SSR value="0" → Next reproduction is AS0 (video)
AS0 (video): No SSR → Final low-latency regular content
**AS3 (audio) **: SSR value="2" → Next reproduction is AS2 (audio)
AS2 (audio): No SSR → Final low-latency regular content
Wiki Update Suggestion
1. Preparing Content for L3D Assets
Target Wiki Page: Preparing Content for livesim2
Suggested Addition: L3D Content Requirements
Add a new section covering content preparation for L3D streaming:
L3D Content Preparation
For L3D to work, content should be encoded with the following considerations:
Video Encoding Parameters: GOP size must be aligned with the chunk duration in frames (e.g. if your video has a GOP size of 6 frames and a frame rate of 30fps, the GOP duration is 6 / 30 = 0.2 seconds. The chunk duration should be a multiple of this value (e.g., 0.2, 0.4))
FFmpeg sample
gpac example
2. New URL Parameters
Target Wiki Page: URL Parameters
Suggested Addition: Low Delay Parameters
Add documentation for the new Low Delay URL parameter:
Low Delay Parameters
ssrASadaptationSetId,ssrValue;adaptationSetId,ssrValue;...wheressrValueis the next adaptation set id/livesim2/ssras_{adaptationSetId, ssrValue}/testpic_2s_low_delay/Manifest.mpdLow Delay Mode Effects: When
ssrASis specified in the URL path, the following modifications are applied to the generated MPD:DASHProfileLinearfor L3D complianceurn:mpeg:dash:ssr:2023specificationurn:mpeg:dash:adaptation-set-switching:2016specificationAdaptationSet@startWithSAP=1for proper stream access pointssapType=1andcadence=1attributesUsage Pattern:
/livesim2/[other-params]/ssras_{adaptationSetId, ssrValue}/[asset-name]/Manifest.mpdCompatibility Notes:
Suggested Addition: Low Delay Chunk Duration Parameters
Add documentation for the new Low Delay Chunk Duration URL parameter:
Low Delay Chunk Duration Parameters
chunkDurSSRadaptationSetId,chunkDur;adaptationSetId,chunkDur;...wherechunkDur/livesim2/chunkdurssr_{adaptationSetId, chunkDur}/testpic_2s_low_delay/Manifest.mpdLow Delay Chunk Duration Mode Effects: When
chunkDurSSRis specified in the URL path, the following modifications are applied to the generated MPD:Usage Pattern:
/livesim2/[other-params]/chunkdurssr_{adaptationSetId, chunkDur}/[asset-name]/Manifest.mpdCompatibility Notes:
ssrAS